// 系统变量放这里
const SYSTEM_INFO = uni.getSystemInfoSync()
// console.log(SYSTEM_INFO)
export const getStatusBarHeight = () => SYSTEM_INFO.statusBarHeight || 15

export const getTitleBarHeight = () => {
	if (uni.getMenuButtonBoundingClientRect) {
		const { top, height } = uni.getMenuButtonBoundingClientRect()
		return height + (top - getStatusBarHeight()) * 2
	} else {
		return 40
	}
}

export const getNavBarHeight = () => getStatusBarHeight() + getTitleBarHeight()

// 针对其他平台特性的兼容
// 有一些平台的状态栏的左侧有个图标，右侧胶囊左边有个反馈
export const getLeftIconLeft = () => {
	// if(tt.getCustomButtonBoundingClientRect){
	// 	const { leftIcon: {left, width} } = tt.getCustomButtonBoundingClientRect()
	// 	return left + parseInt(width)
	// } else {
	// 	return 0
	// }
	
	// #ifdef MP-TOUTIAO
			const { leftIcon: {left, width} } = tt.getCustomButtonBoundingClientRect()
			return left + parseInt(width)
	// #endif
	
	// #ifndef MP-TOUTIAO
			return 0
	// #endif
}